<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/pages/mastertemplate/MasterPage.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="content">
		<p:panel header="#{msg.trangThaiDonHang}">

			<h:form id="donHangForm">
				<p:growl id="growforFile" autoupdate="true"
					life="#{DataConfigBean.growlShow}" />

				<p:dataTable id="dataTable" var="dHang"
					value="#{DonHangBean.listDonHang}" paginator="true" rows="10"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="10,20,50,100"
					filteredValue="#{DonHangBean.listDonHangFiltered}"
					style="width: 100%; margin: 45px auto;" widgetVar="DonHangTable"
					editable="true">

					<f:facet name="header">
						<h:outputText value="#{msg.danhSachDonHang}"
							styleClass="tableHeader" />

					</f:facet>

					<p:ajax event="rowEdit"
						listener="#{DonHangBean.editOrderStatusCell}"
						update=":donHangForm:growforFile" />
				
					<p:column headerText="#{msg.soChungTu}"
						filterBy="#{dHang.soChungTu}" filterMatchMode="contains">#{dHang.soChungTu}  </p:column>

					<p:column headerText="#{msg.loaiDonHang}"
						filterBy="#{dHang.loaiDonHang}" filterMatchMode="exact"
						id="loaidonHang">
						<h:outputText value="#{dHang.loaiDonHang}" />
					</p:column>

					<p:column headerText="#{msg.ngayLap}" filterBy="#{dHang.ngayLap}"
						filterMatchMode="contains">#{dHang.ngayLap}  </p:column>

					<p:column headerText="#{msg.congTy}" filterBy="#{dHang.doiTac}"
						filterMatchMode="contains">#{dHang.doiTac}  </p:column>

					<p:column headerText="#{msg.caNhan}" filterBy="#{dHang.caNhan}"
						filterMatchMode="contains">#{dHang.caNhan}  </p:column>

					<p:column headerText="#{msg.trangthai}"
						filterBy="#{dHang.trangThai}" filterMatchMode="contains">#{dHang.trangThai}  
						
						 <p:cellEditor>
							<f:facet name="output">
								<h:outputText value="#{car.year}" />
							</f:facet>
							<f:facet name="input">
								<p:selectOneMenu styleClass="inputText"
									value="#{dHang.trangThai}" style="width:100%">
									<f:selectItems value="#{DonHangBean.listTrangThai}"
										var="selectItem" itemLabel="#{selectItem}"
										itemValue="#{selectItem}" />
								</p:selectOneMenu>
							</f:facet>
						</p:cellEditor>

					</p:column>

					<p:column style="width:5%">
						<p:rowEditor />
					</p:column>

				</p:dataTable>
			</h:form>
		</p:panel>

	</ui:define>
</ui:composition>
